namespace SmartSoft.Invoices
{
    using SmartSoft;
    using SmartSoft.Controls;
    using SmartSoft.Controls.ChildGridControls;
    using SmartSoft.ADP;
    using System;
    using System.ComponentModel;
    using System.Drawing;
    using System.Windows.Forms;

    public class FormCTNBViewer : FormHistoryViewer
    {
        private OptionColumn Column1;
        private NumericColumn Column10;
        private SearchColumn Column11;
        private SearchColumn Column12;
        private NumericColumn Column13;
        private NumericColumn Column14;
        private NumericColumn Column15;
        private NumericColumn Column16;
        private SearchColumn Column2;
        private DataGridViewTextBoxColumn Column3;
        private OptionColumn Column4;
        private SearchColumn Column5;
        private DateColumn Column6;
        private SearchColumn Column7;
        private SearchColumn Column8;
        private NumericColumn Column9;
        private IContainer components;
        public GridDetail grdDetail;
        private LabelControl lblDesc_EN;
        private LabelControl lblDia_Chi;
        private LabelControl lblDien_Giai;
        private LabelControl lblMa_Bp;
        private LabelControl lblMa_Dt;
        private LabelControl lblMa_Hd;
        private LabelControl lblMa_Tte;
        private LabelControl lblOng_Ba;
        private LabelControl lblTTien_Nt;
        private CTNBDataAccess oMethod = new CTNBDataAccess();
        private TextControl txtDesc_EN;
        private TextControl txtDia_Chi;
        private TextControl txtDien_Giai;
        private TextSearch txtMa_Bp;
        private TextSearch txtMa_Dt;
        private TextSearch txtMa_Hd;
        private TextOption txtMa_Tte;
        private TextControl txtOng_Ba;
        private TextControl txtTen_Bp;
        private TextControl txtTen_Dt;
        private TextControl txtTen_Hd;
        private TextNumeric txtTTien;
        private TextNumeric txtTTien_Nt;
        private TextNumeric txtTy_Gia;

        public FormCTNBViewer()
        {
            this.InitializeComponent();
        }

        protected override void Dispose(bool disposing)
        {
            if (disposing && (this.components != null))
            {
                this.components.Dispose();
            }
            base.Dispose(disposing);
        }

        private void InitializeComponent()
        {
            //ComponentResourceManager manager = new ComponentResourceManager(typeof(FormCTNBViewer));
            DataGridViewCellStyle style = new DataGridViewCellStyle();
            DataGridViewCellStyle style2 = new DataGridViewCellStyle();
            DataGridViewCellStyle style3 = new DataGridViewCellStyle();
            DataGridViewCellStyle style4 = new DataGridViewCellStyle();
            DataGridViewCellStyle style5 = new DataGridViewCellStyle();
            DataGridViewCellStyle style6 = new DataGridViewCellStyle();
            DataGridViewCellStyle style7 = new DataGridViewCellStyle();
            DataGridViewCellStyle style8 = new DataGridViewCellStyle();
            DataGridViewCellStyle style9 = new DataGridViewCellStyle();
            DataGridViewCellStyle style10 = new DataGridViewCellStyle();
            DataGridViewCellStyle style11 = new DataGridViewCellStyle();
            DataGridViewCellStyle style12 = new DataGridViewCellStyle();
            DataGridViewCellStyle style13 = new DataGridViewCellStyle();
            DataGridViewCellStyle style14 = new DataGridViewCellStyle();
            DataGridViewCellStyle style15 = new DataGridViewCellStyle();
            this.txtTTien_Nt = new TextNumeric();
            this.txtTTien = new TextNumeric();
            this.grdDetail = new GridDetail();
            this.Column1 = new OptionColumn();
            this.Column2 = new SearchColumn();
            this.Column7 = new SearchColumn();
            this.Column8 = new SearchColumn();
            this.Column12 = new SearchColumn();
            this.Column3 = new DataGridViewTextBoxColumn();
            this.Column4 = new OptionColumn();
            this.Column11 = new SearchColumn();
            this.Column5 = new SearchColumn();
            this.Column6 = new DateColumn();
            this.Column9 = new NumericColumn();
            this.Column10 = new NumericColumn();
            this.Column13 = new NumericColumn();
            this.Column14 = new NumericColumn();
            this.Column15 = new NumericColumn();
            this.Column16 = new NumericColumn();
            this.txtDesc_EN = new TextControl();
            this.txtDien_Giai = new TextControl();
            this.txtDia_Chi = new TextControl();
            this.txtOng_Ba = new TextControl();
            this.txtTen_Dt = new TextControl();
            this.txtTen_Hd = new TextControl();
            this.txtTen_Bp = new TextControl();
            this.lblDesc_EN = new LabelControl();
            this.lblTTien_Nt = new LabelControl();
            this.txtMa_Dt = new TextSearch();
            this.lblDien_Giai = new LabelControl();
            this.lblDia_Chi = new LabelControl();
            this.lblOng_Ba = new LabelControl();
            this.lblMa_Dt = new LabelControl();
            this.txtMa_Hd = new TextSearch();
            this.lblMa_Hd = new LabelControl();
            this.txtMa_Bp = new TextSearch();
            this.lblMa_Bp = new LabelControl();
            this.txtTy_Gia = new TextNumeric();
            this.lblMa_Tte = new LabelControl();
            this.txtMa_Tte = new TextOption();
            ((ISupportInitialize) this.grdDetail).BeginInit();
            base.SuspendLayout();
            base.txtMa_Loai3.TabIndex = 0x15;
            base.txtMa_Loai2.TabIndex = 20;
            base.txtMa_Loai1.TabIndex = 0x13;
            this.txtTTien_Nt.Anchor = AnchorStyles.Right | AnchorStyles.Bottom;
            this.txtTTien_Nt.BackColor = Color.White;
            this.txtTTien_Nt.Enabled = false;
            this.txtTTien_Nt.Font = new Font("Arial", 8.25f);
            this.txtTTien_Nt.ForeColor = Color.Black;
            this.txtTTien_Nt.Location = new Point(0x259, 0x1e8);
            this.txtTTien_Nt.Name = "txtTTien_Nt";
            int[] bits = new int[4];
            this.txtTTien_Nt.NumericValue = new decimal(bits);
            this.txtTTien_Nt.OldValue = null;
            this.txtTTien_Nt.Size = new Size(90, 20);
            this.txtTTien_Nt.TabIndex = 0x55;
            this.txtTTien_Nt.TextAlign = HorizontalAlignment.Right;
            this.txtTTien_Nt.UserTextNumericFormat = AppInstance.TextNumericFormat.ForeignAmount;
//            this.txtTTien_Nt.Value = null;//manager.GetObject("txtTTien_Nt.Value");
            this.txtTTien.Anchor = AnchorStyles.Right | AnchorStyles.Bottom;
            this.txtTTien.BackColor = Color.White;
            this.txtTTien.Enabled = false;
            this.txtTTien.Font = new Font("Arial", 8.25f);
            this.txtTTien.ForeColor = Color.Black;
            this.txtTTien.Location = new Point(0x2b4, 0x1e8);
            this.txtTTien.Name = "txtTTien";
            int[] numArray2 = new int[4];
            this.txtTTien.NumericValue = new decimal(numArray2);
            this.txtTTien.OldValue = null;
            this.txtTTien.Size = new Size(90, 20);
            this.txtTTien.TabIndex = 0x56;
            this.txtTTien.TextAlign = HorizontalAlignment.Right;
            this.txtTTien.UserTextNumericFormat = AppInstance.TextNumericFormat.LocalAmount;
//            this.txtTTien.Value = null;//manager.GetObject("txtTTien.Value");
            this.grdDetail.AllowUserToAddRows = false;
            this.grdDetail.AllowUserToDeleteRows = false;
            this.grdDetail.Anchor = AnchorStyles.Right | AnchorStyles.Left | AnchorStyles.Bottom | AnchorStyles.Top;
            this.grdDetail.CheckAutoSize = true;
            this.grdDetail.CheckColor = false;
            this.grdDetail.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.AutoSize;
            this.grdDetail.Columns.AddRange(new DataGridViewColumn[] { this.Column1, this.Column2, this.Column7, this.Column8, this.Column12, this.Column3, this.Column4, this.Column11, this.Column5, this.Column6, this.Column9, this.Column10, this.Column13, this.Column14, this.Column15, this.Column16 });
            this.grdDetail.FirstColumnIndex = 1;
            this.grdDetail.Font = new Font("Arial", 8.25f);
            this.grdDetail.Location = new Point(0, 0x9f);
            this.grdDetail.Name = "grdDetail";
            this.grdDetail.Size = new Size(0x31a, 0x143);
            this.grdDetail.TabIndex = 15;
            this.Column1.DataPropertyName = "No_Co";
            style.Alignment = DataGridViewContentAlignment.MiddleCenter;
            this.Column1.DefaultCellStyle = style;
            this.Column1.DisabledForeColor = Color.Blue;
            this.Column1.HeaderText = "Ps";
            this.Column1.InputMask = "N,C";
            this.Column1.Name = "Column1";
            this.Column1.ReadOnly = true;
            this.Column1.Resizable = DataGridViewTriState.False;
            this.Column1.SortMode = DataGridViewColumnSortMode.Automatic;
            this.Column1.UserTextLength = AppInstance.TextControlLength.None;
            this.Column1.Width = 20;
            this.Column2.DataPropertyName = "Tk";
            style2.Alignment = DataGridViewContentAlignment.MiddleLeft;
            this.Column2.DefaultCellStyle = style2;
            this.Column2.DestinationFields = "Ten_Tk";
            this.Column2.DisabledForeColor = Color.Blue;
            this.Column2.EmptyIsValid = true;
            this.Column2.FirstFilter = "Loai_Tk = 'C'";
            this.Column2.HeaderText = "T\x00e0i khoản";
            this.Column2.Name = "Column2";
            this.Column2.ReadOnly = true;
            this.Column2.SortMode = DataGridViewColumnSortMode.Automatic;
            this.Column2.SourceFields = "Ten_Tk";
            this.Column2.TableName = "DMTK";
            this.Column2.UserTrimMode = AppInstance.TextControlTrimMode.All;
            this.Column2.Width = 30;
            this.Column7.DataPropertyName = "Ma_Bp";
            style3.Alignment = DataGridViewContentAlignment.MiddleLeft;
            this.Column7.DefaultCellStyle = style3;
            this.Column7.DestinationFields = "Ten_Bp";
            this.Column7.DisabledForeColor = Color.Blue;
            this.Column7.EmptyIsValid = true;
            this.Column7.HeaderText = "Bộ phận";
            this.Column7.Name = "Column7";
            this.Column7.ReadOnly = true;
            this.Column7.SortMode = DataGridViewColumnSortMode.Automatic;
            this.Column7.SourceFields = "Ten_Bp";
            this.Column7.TableName = "DMBP";
            this.Column7.UserTrimMode = AppInstance.TextControlTrimMode.All;
            this.Column7.Width = 40;
            this.Column8.DataPropertyName = "Ma_Hd";
            style4.Alignment = DataGridViewContentAlignment.MiddleLeft;
            this.Column8.DefaultCellStyle = style4;
            this.Column8.DestinationFields = "Ten_Hd";
            this.Column8.DisabledForeColor = Color.Blue;
            this.Column8.EmptyIsValid = true;
            this.Column8.HeaderText = "Hợp đồng";
            this.Column8.Name = "Column8";
            this.Column8.ReadOnly = true;
            this.Column8.SortMode = DataGridViewColumnSortMode.Automatic;
            this.Column8.SourceFields = "Ten_Hd";
            this.Column8.TableName = "DMHD";
            this.Column8.UserTrimMode = AppInstance.TextControlTrimMode.All;
            this.Column8.Width = 40;
            this.Column12.DataPropertyName = "Ma_Vt";
            style5.Alignment = DataGridViewContentAlignment.MiddleLeft;
            this.Column12.DefaultCellStyle = style5;
            this.Column12.DestinationFields = "Ten_Vt, Dvt";
            this.Column12.DisabledForeColor = Color.Blue;
            this.Column12.FirstFilter = "Is_Stop = '1'";
            this.Column12.HeaderText = "Vật tư";
            this.Column12.Name = "Column12";
            this.Column12.ReadOnly = true;
            this.Column12.SortMode = DataGridViewColumnSortMode.Automatic;
            this.Column12.SourceFields = "Ten_Vt, Dvt";
            this.Column12.TableName = "DMVT";
            this.Column12.UserTrimMode = AppInstance.TextControlTrimMode.All;
            this.Column12.Width = 40;
            this.Column3.DataPropertyName = "Ten_Vt";
            this.Column3.HeaderText = "Tên vật tư";
            this.Column3.Name = "Column3";
            this.Column3.ReadOnly = true;
            this.Column3.Width = 0x88;
            this.Column4.DataPropertyName = "Dvt";
            style6.Alignment = DataGridViewContentAlignment.MiddleLeft;
            this.Column4.DefaultCellStyle = style6;
            this.Column4.DisabledForeColor = Color.Blue;
            this.Column4.HeaderText = "Đvt";
            this.Column4.Name = "Column4";
            this.Column4.ReadOnly = true;
            this.Column4.Resizable = DataGridViewTriState.True;
            this.Column4.SortMode = DataGridViewColumnSortMode.Automatic;
            this.Column4.UserTextLength = AppInstance.TextControlLength.None;
            this.Column4.Width = 30;
            this.Column11.DataPropertyName = "Ma_Kho";
            style7.Alignment = DataGridViewContentAlignment.MiddleLeft;
            this.Column11.DefaultCellStyle = style7;
            this.Column11.DestinationFields = "Ten_Kho";
            this.Column11.DisabledForeColor = Color.Blue;
            this.Column11.HeaderText = "Kho";
            this.Column11.Name = "Column11";
            this.Column11.ReadOnly = true;
            this.Column11.SortMode = DataGridViewColumnSortMode.Automatic;
            this.Column11.SourceFields = "Ten_Kho";
            this.Column11.TableName = "DMKHO";
            this.Column11.UserTrimMode = AppInstance.TextControlTrimMode.All;
            this.Column11.Width = 40;
            this.Column5.DataPropertyName = "Lo_Hang";
            style8.Alignment = DataGridViewContentAlignment.MiddleLeft;
            this.Column5.DefaultCellStyle = style8;
            this.Column5.DisabledForeColor = Color.Blue;
            this.Column5.HeaderText = "L\x00f4 hàng";
            this.Column5.Name = "Column5";
            this.Column5.ReadOnly = true;
            this.Column5.Resizable = DataGridViewTriState.True;
            this.Column5.SortMode = DataGridViewColumnSortMode.Automatic;
            this.Column5.Width = 40;
            this.Column6.DataPropertyName = "Han_Dung";
            style9.Alignment = DataGridViewContentAlignment.MiddleLeft;
            this.Column6.DefaultCellStyle = style9;
            this.Column6.HeaderText = "Hạn d\x00f9ng";
            this.Column6.Name = "Column6";
            this.Column6.ReadOnly = true;
            this.Column6.Resizable = DataGridViewTriState.True;
            this.Column6.SortMode = DataGridViewColumnSortMode.Automatic;
            this.Column6.Width = 0x3e;
            this.Column9.DataPropertyName = "H_Luong";
            style10.Alignment = DataGridViewContentAlignment.MiddleRight;
            this.Column9.DefaultCellStyle = style10;
            this.Column9.HeaderText = "H\x00e0m lượng";
            this.Column9.Name = "Column9";
            this.Column9.ReadOnly = true;
            this.Column9.Resizable = DataGridViewTriState.True;
            this.Column9.SortMode = DataGridViewColumnSortMode.Automatic;
            this.Column9.UserTextNumericFormat = AppInstance.TextNumericFormat.Percent;
            this.Column9.Width = 0x1a;
            this.Column10.DataPropertyName = "Do_Am_PT";
            style11.Alignment = DataGridViewContentAlignment.MiddleRight;
            this.Column10.DefaultCellStyle = style11;
            this.Column10.HeaderText = "Độ ẩm";
            this.Column10.Name = "Column10";
            this.Column10.ReadOnly = true;
            this.Column10.Resizable = DataGridViewTriState.True;
            this.Column10.SortMode = DataGridViewColumnSortMode.Automatic;
            this.Column10.UserTextNumericFormat = AppInstance.TextNumericFormat.Percent;
            this.Column10.Width = 0x1a;
            this.Column13.DataPropertyName = "Do_Con_PT";
            style12.Alignment = DataGridViewContentAlignment.MiddleRight;
            this.Column13.DefaultCellStyle = style12;
            this.Column13.FillWeight = 90f;
            this.Column13.HeaderText = "Độ cồn";
            this.Column13.Name = "Column13";
            this.Column13.ReadOnly = true;
            this.Column13.Resizable = DataGridViewTriState.True;
            this.Column13.SortMode = DataGridViewColumnSortMode.Automatic;
            this.Column13.UserTextNumericFormat = AppInstance.TextNumericFormat.Percent;
            this.Column13.Width = 0x1a;
            this.Column14.DataPropertyName = "So_Luong9";
            style13.Alignment = DataGridViewContentAlignment.MiddleRight;
            this.Column14.DefaultCellStyle = style13;
            this.Column14.FillWeight = 90f;
            this.Column14.HeaderText = "Số lượng";
            this.Column14.Name = "Column14";
            this.Column14.ReadOnly = true;
            this.Column14.Resizable = DataGridViewTriState.True;
            this.Column14.SortMode = DataGridViewColumnSortMode.Automatic;
            this.Column14.UserTextNumericFormat = AppInstance.TextNumericFormat.Quantity;
            this.Column14.Width = 60;
            this.Column14.ZeroIsValid = true;
            this.Column15.DataPropertyName = "Gia_Nt9";
            style14.Alignment = DataGridViewContentAlignment.MiddleRight;
            this.Column15.DefaultCellStyle = style14;
            this.Column15.HeaderText = "Đơn giá";
            this.Column15.Name = "Column15";
            this.Column15.ReadOnly = true;
            this.Column15.SortMode = DataGridViewColumnSortMode.Automatic;
            this.Column15.UserTextNumericFormat = AppInstance.TextNumericFormat.ForeignPrice;
            this.Column15.Width = 0x41;
            this.Column15.ZeroIsValid = true;
            this.Column16.DataPropertyName = "Tien_Nt";
            style15.Alignment = DataGridViewContentAlignment.MiddleRight;
            this.Column16.DefaultCellStyle = style15;
            this.Column16.HeaderText = "Thành tiền";
            this.Column16.Name = "Column16";
            this.Column16.ReadOnly = true;
            this.Column16.SortMode = DataGridViewColumnSortMode.Automatic;
            this.Column16.UserTextNumericFormat = AppInstance.TextNumericFormat.ForeignAmount;
            this.Column16.Width = 70;
            this.Column16.ZeroIsValid = true;
            this.txtDesc_EN.Anchor = AnchorStyles.Right | AnchorStyles.Top;
            this.txtDesc_EN.CheckTextSearched = false;
            this.txtDesc_EN.DisabledForeColor = Color.Blue;
            this.txtDesc_EN.Font = new Font("Arial", 8.25f);
            this.txtDesc_EN.Location = new Point(0x1e7, 0x85);
            this.txtDesc_EN.MaxLength = 0xfe;
            this.txtDesc_EN.Name = "txtDesc_EN";
            this.txtDesc_EN.OldValue = null;
            this.txtDesc_EN.ReadOnly = true;
            this.txtDesc_EN.Size = new Size(0x127, 20);
            this.txtDesc_EN.TabIndex = 14;
            this.txtDesc_EN.UserTextLength = AppInstance.TextControlLength.InvoiceDescription;
//            this.txtDesc_EN.Value = null;//manager.GetObject("txtDesc_EN.Value");
            this.txtDien_Giai.CheckTextSearched = false;
            this.txtDien_Giai.DisabledForeColor = Color.Blue;
            this.txtDien_Giai.Font = new Font("Arial", 8.25f);
            this.txtDien_Giai.Location = new Point(0x63, 0x85);
            this.txtDien_Giai.MaxLength = 0xfe;
            this.txtDien_Giai.Name = "txtDien_Giai";
            this.txtDien_Giai.OldValue = null;
            this.txtDien_Giai.ReadOnly = true;
            this.txtDien_Giai.Size = new Size(0x128, 20);
            this.txtDien_Giai.TabIndex = 13;
            this.txtDien_Giai.UserTextLength = AppInstance.TextControlLength.InvoiceDescription;
//            this.txtDien_Giai.Value = null;//manager.GetObject("txtDien_Giai.Value");
            this.txtDia_Chi.Anchor = AnchorStyles.Right | AnchorStyles.Top;
            this.txtDia_Chi.CheckTextSearched = false;
            this.txtDia_Chi.DisabledForeColor = Color.Blue;
            this.txtDia_Chi.Font = new Font("Arial", 8.25f);
            this.txtDia_Chi.Location = new Point(0x1e7, 0x70);
            this.txtDia_Chi.MaxLength = 0x80;
            this.txtDia_Chi.Name = "txtDia_Chi";
            this.txtDia_Chi.OldValue = null;
            this.txtDia_Chi.ReadOnly = true;
            this.txtDia_Chi.Size = new Size(0x127, 20);
            this.txtDia_Chi.TabIndex = 12;
            this.txtDia_Chi.UserTextLength = AppInstance.TextControlLength.ItemDescription;
//            this.txtDia_Chi.Value = null;//manager.GetObject("txtDia_Chi.Value");
            this.txtOng_Ba.CheckTextSearched = false;
            this.txtOng_Ba.DisabledForeColor = Color.Blue;
            this.txtOng_Ba.Font = new Font("Arial", 8.25f);
            this.txtOng_Ba.Location = new Point(0x63, 0x70);
            this.txtOng_Ba.MaxLength = 0x80;
            this.txtOng_Ba.Name = "txtOng_Ba";
            this.txtOng_Ba.OldValue = null;
            this.txtOng_Ba.ReadOnly = true;
            this.txtOng_Ba.Size = new Size(0x128, 20);
            this.txtOng_Ba.TabIndex = 11;
            this.txtOng_Ba.UserTextLength = AppInstance.TextControlLength.ItemDescription;
//            this.txtOng_Ba.Value = null;//manager.GetObject("txtOng_Ba.Value");
            this.txtTen_Dt.Anchor = AnchorStyles.Right | AnchorStyles.Left | AnchorStyles.Top;
            this.txtTen_Dt.BackColor = SystemColors.Control;
            this.txtTen_Dt.BorderStyle = BorderStyle.None;
            this.txtTen_Dt.CheckTextSearched = false;
            this.txtTen_Dt.DisabledForeColor = Color.Blue;
            this.txtTen_Dt.Enabled = false;
            this.txtTen_Dt.Font = new Font("Arial", 8.25f);
            this.txtTen_Dt.ForeColor = Color.Blue;
            this.txtTen_Dt.Location = new Point(0xdf, 0x5e);
            this.txtTen_Dt.Name = "txtTen_Dt";
            this.txtTen_Dt.OldValue = null;
            this.txtTen_Dt.Size = new Size(0x22f, 13);
            this.txtTen_Dt.TabIndex = 0x48;
//            this.txtTen_Dt.Value = null;//manager.GetObject("txtTen_Dt.Value");
            this.txtTen_Hd.Anchor = AnchorStyles.Right | AnchorStyles.Left | AnchorStyles.Top;
            this.txtTen_Hd.BackColor = SystemColors.Control;
            this.txtTen_Hd.BorderStyle = BorderStyle.None;
            this.txtTen_Hd.CheckTextSearched = false;
            this.txtTen_Hd.DisabledForeColor = Color.Blue;
            this.txtTen_Hd.Enabled = false;
            this.txtTen_Hd.Font = new Font("Arial", 8.25f);
            this.txtTen_Hd.ForeColor = Color.Blue;
            this.txtTen_Hd.Location = new Point(0xdf, 0x49);
            this.txtTen_Hd.Name = "txtTen_Hd";
            this.txtTen_Hd.OldValue = null;
            this.txtTen_Hd.Size = new Size(0x22f, 13);
            this.txtTen_Hd.TabIndex = 0x49;
//            this.txtTen_Hd.Value = null;//manager.GetObject("txtTen_Hd.Value");
            this.txtTen_Bp.Anchor = AnchorStyles.Right | AnchorStyles.Left | AnchorStyles.Top;
            this.txtTen_Bp.BackColor = SystemColors.Control;
            this.txtTen_Bp.BorderStyle = BorderStyle.None;
            this.txtTen_Bp.CheckTextSearched = false;
            this.txtTen_Bp.DisabledForeColor = Color.Blue;
            this.txtTen_Bp.Enabled = false;
            this.txtTen_Bp.Font = new Font("Arial", 8.25f);
            this.txtTen_Bp.ForeColor = Color.Blue;
            this.txtTen_Bp.Location = new Point(0xdf, 0x34);
            this.txtTen_Bp.Name = "txtTen_Bp";
            this.txtTen_Bp.OldValue = null;
            this.txtTen_Bp.Size = new Size(0x22f, 13);
            this.txtTen_Bp.TabIndex = 0x4a;
//            this.txtTen_Bp.Value = null;//manager.GetObject("txtTen_Bp.Value");
            this.lblDesc_EN.Anchor = AnchorStyles.Right | AnchorStyles.Top;
            this.lblDesc_EN.AutoSize = true;
            this.lblDesc_EN.Font = new Font("Arial", 8.25f);
            this.lblDesc_EN.Location = new Point(410, 0x88);
            this.lblDesc_EN.Name = "lblDesc_EN";
            this.lblDesc_EN.Size = new Size(0x47, 14);
            this.lblDesc_EN.TabIndex = 0x41;
            this.lblDesc_EN.Text = "Diễn giải (EN)";
            this.lblTTien_Nt.Anchor = AnchorStyles.Right | AnchorStyles.Bottom;
            this.lblTTien_Nt.AutoSize = true;
            this.lblTTien_Nt.Font = new Font("Arial", 8.25f);
            this.lblTTien_Nt.Location = new Point(0x219, 0x1eb);
            this.lblTTien_Nt.Name = "lblTTien_Nt";
            this.lblTTien_Nt.Size = new Size(0x3a, 14);
            this.lblTTien_Nt.TabIndex = 0x3d;
            this.lblTTien_Nt.Text = "Tổng cộng";
            this.txtMa_Dt.CharacterCasing = CharacterCasing.Upper;
            this.txtMa_Dt.CheckTextSearched = false;
            this.txtMa_Dt.DisabledForeColor = Color.Empty;
            this.txtMa_Dt.EmptyIsValid = true;
            this.txtMa_Dt.FieldDisplay = "Ten_Dt";
            this.txtMa_Dt.FirstFilter = "Is_Stop = '1'";
            this.txtMa_Dt.Font = new Font("Arial", 8.25f);
            this.txtMa_Dt.Location = new Point(0x63, 0x5b);
            this.txtMa_Dt.MaxLength = 0x20;
            this.txtMa_Dt.Name = "txtMa_Dt";
            this.txtMa_Dt.OldValue = null;
            this.txtMa_Dt.ReadOnly = true;
            this.txtMa_Dt.Size = new Size(0x76, 20);
            this.txtMa_Dt.TabIndex = 10;
            this.txtMa_Dt.TableName = "DMDT";
            this.txtMa_Dt.TextDisplay = this.txtTen_Dt;
            this.txtMa_Dt.UserTextLength = AppInstance.TextControlLength.ItemCode;
            this.txtMa_Dt.UserTrimMode = AppInstance.TextControlTrimMode.All;
//            this.txtMa_Dt.Value = null;//manager.GetObject("txtMa_Dt.Value");
            this.lblDien_Giai.AutoSize = true;
            this.lblDien_Giai.Font = new Font("Arial", 8.25f);
            this.lblDien_Giai.Location = new Point(12, 0x88);
            this.lblDien_Giai.Name = "lblDien_Giai";
            this.lblDien_Giai.Size = new Size(0x49, 14);
            this.lblDien_Giai.TabIndex = 0x42;
            this.lblDien_Giai.Text = "Diễn giải (VN)";
            this.lblDia_Chi.Anchor = AnchorStyles.Right | AnchorStyles.Top;
            this.lblDia_Chi.AutoSize = true;
            this.lblDia_Chi.Font = new Font("Arial", 8.25f);
            this.lblDia_Chi.Location = new Point(0x1b9, 0x73);
            this.lblDia_Chi.Name = "lblDia_Chi";
            this.lblDia_Chi.Size = new Size(40, 14);
            this.lblDia_Chi.TabIndex = 70;
            this.lblDia_Chi.Text = "Địa chỉ";
            this.lblOng_Ba.AutoSize = true;
            this.lblOng_Ba.Font = new Font("Arial", 8.25f);
            this.lblOng_Ba.Location = new Point(12, 0x73);
            this.lblOng_Ba.Name = "lblOng_Ba";
            this.lblOng_Ba.Size = new Size(0x2a, 14);
            this.lblOng_Ba.TabIndex = 0x47;
            this.lblOng_Ba.Text = "\x00d4ng b\x00e0";
            this.lblMa_Dt.AutoSize = true;
            this.lblMa_Dt.Font = new Font("Arial", 8.25f);
            this.lblMa_Dt.Location = new Point(12, 0x5e);
            this.lblMa_Dt.Name = "lblMa_Dt";
            this.lblMa_Dt.Size = new Size(0x37, 14);
            this.lblMa_Dt.TabIndex = 0x45;
            this.lblMa_Dt.Text = "Đối tượng";
            this.txtMa_Hd.CharacterCasing = CharacterCasing.Upper;
            this.txtMa_Hd.CheckTextSearched = false;
            this.txtMa_Hd.DisabledForeColor = Color.Empty;
            this.txtMa_Hd.EmptyIsValid = true;
            this.txtMa_Hd.FieldDisplay = "Ten_Hd";
            this.txtMa_Hd.Font = new Font("Arial", 8.25f);
            this.txtMa_Hd.FoundIsValid = true;
            this.txtMa_Hd.Location = new Point(0x63, 70);
            this.txtMa_Hd.MaxLength = 0x20;
            this.txtMa_Hd.Name = "txtMa_Hd";
            this.txtMa_Hd.OldValue = null;
            this.txtMa_Hd.ReadOnly = true;
            this.txtMa_Hd.Size = new Size(0x76, 20);
            this.txtMa_Hd.TabIndex = 9;
            this.txtMa_Hd.TableName = "DMHD";
            this.txtMa_Hd.TextDisplay = this.txtTen_Hd;
            this.txtMa_Hd.UserTextLength = AppInstance.TextControlLength.ItemCode;
            this.txtMa_Hd.UserTrimMode = AppInstance.TextControlTrimMode.All;
//            this.txtMa_Hd.Value = null;//manager.GetObject("txtMa_Hd.Value");
            this.lblMa_Hd.AutoSize = true;
            this.lblMa_Hd.Font = new Font("Arial", 8.25f);
            this.lblMa_Hd.Location = new Point(12, 0x49);
            this.lblMa_Hd.Name = "lblMa_Hd";
            this.lblMa_Hd.Size = new Size(0x36, 14);
            this.lblMa_Hd.TabIndex = 0x43;
            this.lblMa_Hd.Text = "Hợp đồng";
            this.txtMa_Bp.CharacterCasing = CharacterCasing.Upper;
            this.txtMa_Bp.CheckTextSearched = false;
            this.txtMa_Bp.DisabledForeColor = Color.Empty;
            this.txtMa_Bp.EmptyIsValid = true;
            this.txtMa_Bp.FieldDisplay = "Ten_Bp";
            this.txtMa_Bp.Font = new Font("Arial", 8.25f);
            this.txtMa_Bp.FoundIsValid = true;
            this.txtMa_Bp.Location = new Point(0x63, 0x31);
            this.txtMa_Bp.MaxLength = 0x20;
            this.txtMa_Bp.Name = "txtMa_Bp";
            this.txtMa_Bp.OldValue = null;
            this.txtMa_Bp.ReadOnly = true;
            this.txtMa_Bp.Size = new Size(0x76, 20);
            this.txtMa_Bp.TabIndex = 8;
            this.txtMa_Bp.TableName = "DMBP";
            this.txtMa_Bp.TextDisplay = this.txtTen_Bp;
            this.txtMa_Bp.UserTextLength = AppInstance.TextControlLength.ItemCode;
            this.txtMa_Bp.UserTrimMode = AppInstance.TextControlTrimMode.All;
//            this.txtMa_Bp.Value = null;//manager.GetObject("txtMa_Bp.Value");
            this.lblMa_Bp.AutoSize = true;
            this.lblMa_Bp.Font = new Font("Arial", 8.25f);
            this.lblMa_Bp.Location = new Point(12, 0x34);
            this.lblMa_Bp.Name = "lblMa_Bp";
            this.lblMa_Bp.Size = new Size(0x2f, 14);
            this.lblMa_Bp.TabIndex = 0x44;
            this.lblMa_Bp.Text = "Bộ phận";
            this.txtTy_Gia.Anchor = AnchorStyles.Right | AnchorStyles.Top;
            this.txtTy_Gia.BackColor = Color.White;
            this.txtTy_Gia.DisabledBackColor = Color.Empty;
            this.txtTy_Gia.Font = new Font("Arial", 8.25f);
            this.txtTy_Gia.ForeColor = Color.Black;
            this.txtTy_Gia.Location = new Point(0x2d4, 0x1c);
            this.txtTy_Gia.Name = "txtTy_Gia";
            int[] numArray3 = new int[4];
            this.txtTy_Gia.NumericValue = new decimal(numArray3);
            this.txtTy_Gia.OldValue = null;
            this.txtTy_Gia.ReadOnly = true;
            this.txtTy_Gia.Size = new Size(0x3a, 20);
            this.txtTy_Gia.TabIndex = 7;
            this.txtTy_Gia.TextAlign = HorizontalAlignment.Right;
            this.txtTy_Gia.UserTextNumericFormat = AppInstance.TextNumericFormat.ExchangeRate;
//            this.txtTy_Gia.Value = null;//manager.GetObject("txtTy_Gia.Value");
            this.lblMa_Tte.Anchor = AnchorStyles.Right | AnchorStyles.Top;
            this.lblMa_Tte.AutoSize = true;
            this.lblMa_Tte.Font = new Font("Arial", 8.25f);
            this.lblMa_Tte.Location = new Point(0x28c, 0x1f);
            this.lblMa_Tte.Name = "lblMa_Tte";
            this.lblMa_Tte.Size = new Size(0x27, 14);
            this.lblMa_Tte.TabIndex = 0x3d;
            this.lblMa_Tte.Text = "Tiền tệ";
            this.txtMa_Tte.Anchor = AnchorStyles.Right | AnchorStyles.Top;
            this.txtMa_Tte.CharacterCasing = CharacterCasing.Upper;
            this.txtMa_Tte.CheckTextSearched = false;
            this.txtMa_Tte.DisabledForeColor = Color.Blue;
            this.txtMa_Tte.Font = new Font("Arial", 8.25f);
            this.txtMa_Tte.InputMask = "USD,VND";
            this.txtMa_Tte.Location = new Point(0x2b9, 0x1c);
            this.txtMa_Tte.Name = "txtMa_Tte";
            this.txtMa_Tte.OldValue = null;
            this.txtMa_Tte.ReadOnly = true;
            this.txtMa_Tte.Size = new Size(0x1c, 20);
            this.txtMa_Tte.TabIndex = 6;
            this.txtMa_Tte.Text = "USD";
            this.txtMa_Tte.Value = "USD";
            base.AutoScaleDimensions = new SizeF(6f, 13f);
            base.ClientSize = new Size(0x31a, 0x214);
            base.Controls.Add(this.txtMa_Tte);
            base.Controls.Add(this.txtTTien_Nt);
            base.Controls.Add(this.txtTy_Gia);
            base.Controls.Add(this.txtTTien);
            base.Controls.Add(this.grdDetail);
            base.Controls.Add(this.txtDesc_EN);
            base.Controls.Add(this.txtDien_Giai);
            base.Controls.Add(this.txtDia_Chi);
            base.Controls.Add(this.txtOng_Ba);
            base.Controls.Add(this.txtTen_Dt);
            base.Controls.Add(this.txtTen_Hd);
            base.Controls.Add(this.txtTen_Bp);
            base.Controls.Add(this.lblDesc_EN);
            base.Controls.Add(this.lblMa_Tte);
            base.Controls.Add(this.lblTTien_Nt);
            base.Controls.Add(this.txtMa_Dt);
            base.Controls.Add(this.lblDien_Giai);
            base.Controls.Add(this.lblDia_Chi);
            base.Controls.Add(this.lblOng_Ba);
            base.Controls.Add(this.lblMa_Dt);
            base.Controls.Add(this.txtMa_Hd);
            base.Controls.Add(this.lblMa_Hd);
            base.Controls.Add(this.txtMa_Bp);
            base.Controls.Add(this.lblMa_Bp);
            base.Name = "FormCTNBViewer";
            base.Controls.SetChildIndex(base.txtSo_Ct, 0);
            base.Controls.SetChildIndex(base.txtNgay_Ps, 0);
            base.Controls.SetChildIndex(base.txtNgay_Ct, 0);
            base.Controls.SetChildIndex(base.lblPhan_Loai, 0);
            base.Controls.SetChildIndex(base.txtMa_Loai1, 0);
            base.Controls.SetChildIndex(base.txtMa_Loai2, 0);
            base.Controls.SetChildIndex(base.txtMa_Loai3, 0);
            base.Controls.SetChildIndex(this.lblMa_Bp, 0);
            base.Controls.SetChildIndex(this.txtMa_Bp, 0);
            base.Controls.SetChildIndex(this.lblMa_Hd, 0);
            base.Controls.SetChildIndex(this.txtMa_Hd, 0);
            base.Controls.SetChildIndex(this.lblMa_Dt, 0);
            base.Controls.SetChildIndex(this.lblOng_Ba, 0);
            base.Controls.SetChildIndex(this.lblDia_Chi, 0);
            base.Controls.SetChildIndex(this.lblDien_Giai, 0);
            base.Controls.SetChildIndex(this.txtMa_Dt, 0);
            base.Controls.SetChildIndex(this.lblTTien_Nt, 0);
            base.Controls.SetChildIndex(this.lblMa_Tte, 0);
            base.Controls.SetChildIndex(this.lblDesc_EN, 0);
            base.Controls.SetChildIndex(this.txtTen_Bp, 0);
            base.Controls.SetChildIndex(this.txtTen_Hd, 0);
            base.Controls.SetChildIndex(this.txtTen_Dt, 0);
            base.Controls.SetChildIndex(this.txtOng_Ba, 0);
            base.Controls.SetChildIndex(this.txtDia_Chi, 0);
            base.Controls.SetChildIndex(this.txtDien_Giai, 0);
            base.Controls.SetChildIndex(this.txtDesc_EN, 0);
            base.Controls.SetChildIndex(this.grdDetail, 0);
            base.Controls.SetChildIndex(this.txtTTien, 0);
            base.Controls.SetChildIndex(this.txtTy_Gia, 0);
            base.Controls.SetChildIndex(this.txtTTien_Nt, 0);
            base.Controls.SetChildIndex(this.txtMa_Tte, 0);
            ((ISupportInitialize) this.grdDetail).EndInit();
            base.ResumeLayout(false);
            base.PerformLayout();
        }

        internal override void OnResetControls()
        {
            base.DetailGridBrowser = this.grdDetail;
            int num = 0;
            if (base.SSInvoiceParameters.AllowDepartmentControl != 1)
            {
                num += this.txtMa_Hd.Top - this.txtMa_Bp.Top;
                this.lblMa_Bp.Visible = false;
                this.txtMa_Bp.Visible = false;
                this.txtTen_Bp.Visible = false;
            }
            if (base.SSInvoiceParameters.AllowContractControl != 1)
            {
                num += this.txtMa_Dt.Top - this.txtMa_Hd.Top;
                this.lblMa_Hd.Visible = false;
                this.txtMa_Hd.Visible = false;
                this.txtTen_Hd.Visible = false;
            }
            if (num != 0)
            {
                if (base.SSInvoiceParameters.AllowContractControl == 1)
                {
                    this.lblMa_Hd.Top -= num;
                    this.txtMa_Hd.Top -= num;
                    this.txtTen_Hd.Top -= num;
                }
                this.lblMa_Dt.Top -= num;
                this.txtMa_Dt.Top -= num;
                this.txtTen_Dt.Top -= num;
                this.lblOng_Ba.Top -= num;
                this.txtOng_Ba.Top -= num;
                this.lblDia_Chi.Top -= num;
                this.txtDia_Chi.Top -= num;
                this.lblDien_Giai.Top -= num;
                this.txtDien_Giai.Top -= num;
                this.lblDesc_EN.Top -= num;
                this.txtDesc_EN.Top -= num;
                base.DetailGridBrowser.Top = this.grdDetail.Top - num;
                base.DetailGridBrowser.Height = this.grdDetail.Height + num;
            }
            if (!base.SSInvoiceParameters.BilingualUsed)
            {
                this.lblDesc_EN.Visible = false;
                this.txtDesc_EN.Visible = false;
                this.txtDien_Giai.Width = (this.txtDesc_EN.Left + this.txtDesc_EN.Width) - this.txtDien_Giai.Left;
                this.txtDien_Giai.Anchor = AnchorStyles.Right | AnchorStyles.Left | AnchorStyles.Top;
            }
            if (base.SSInvoiceParameters.AllowDepartmentControl != 2)
            {
                base.DetailGridBrowser.Columns[2].Visible = false;
            }
            if (base.SSInvoiceParameters.AllowContractControl != 2)
            {
                base.DetailGridBrowser.Columns[3].Visible = false;
            }
            if (!AppInstance.LotNumberCtrl)
            {
                base.DetailGridBrowser.Columns[8].Visible = false;
            }
            if (!AppInstance.DeadLineCtrl)
            {
                base.DetailGridBrowser.Columns[9].Visible = false;
            }
            if (!AppInstance.QualityCtrl)
            {
                base.DetailGridBrowser.Columns[10].Visible = false;
            }
            if (!AppInstance.DampCtrl)
            {
                base.DetailGridBrowser.Columns[11].Visible = false;
            }
            if (!AppInstance.AlcoholCtrl)
            {
                base.DetailGridBrowser.Columns[12].Visible = false;
            }
            if (base.SSInvoiceParameters.FreeFields <= 0)
            {
                num = base.txtMa_Loai1.Top - this.txtTTien_Nt.Top;
                this.lblTTien_Nt.Top += num;
                this.txtTTien_Nt.Top += num;
                this.txtTTien.Top += num;
                base.DetailGridBrowser.Height = this.grdDetail.Height + num;
            }
            base.OnResetControls();
        }

        protected override void OnResize(EventArgs e)
        {
            base.OnResize(e);
            if (this.txtOng_Ba != null)
            {
                int num = base.ClientSize.Width - 0xcb;
                this.txtOng_Ba.Width = num / 2;
                this.txtDia_Chi.Left = (this.txtOng_Ba.Left + this.txtOng_Ba.Width) + 0x5c;
                this.txtDia_Chi.Width = num - this.txtOng_Ba.Width;
                this.lblDia_Chi.Left = (this.txtDia_Chi.Left - this.lblDia_Chi.Width) - 6;
                if ((base.SSInvoiceParameters != null) && base.SSInvoiceParameters.BilingualUsed)
                {
                    this.txtDien_Giai.Width = this.txtOng_Ba.Width;
                    this.txtDesc_EN.Left = this.txtDia_Chi.Left;
                    this.txtDesc_EN.Width = this.txtDia_Chi.Width;
                    this.lblDesc_EN.Left = (this.txtDesc_EN.Left - this.lblDesc_EN.Width) - 6;
                }
            }
        }

        internal override void OnShow()
        {
            base.OnShow();
            this.txtMa_Tte.Value = base.LocalMasterRow["Ma_Tte"];
            this.txtTy_Gia.Value = base.LocalMasterRow["Ty_Gia"];
            this.txtMa_Bp.Value = base.LocalMasterRow["Ma_Bp"];
            this.txtTen_Bp.Value = base.LocalMasterRow["Ten_Bp"];
            this.txtMa_Hd.Value = base.LocalMasterRow["Ma_Hd"];
            this.txtTen_Hd.Value = base.LocalMasterRow["Ten_Hd"];
            this.txtMa_Dt.Value = base.LocalMasterRow["Ma_Dt"];
            this.txtTen_Dt.Value = base.LocalMasterRow["Ten_Dt"];
            this.txtOng_Ba.Value = base.LocalMasterRow["Ong_Ba"];
            this.txtDia_Chi.Value = base.LocalMasterRow["Dia_Chi"];
            this.txtDien_Giai.Value = base.LocalMasterRow["Dien_Giai"];
            this.txtDesc_EN.Value = base.LocalMasterRow["Desc_EN"];
            this.txtTTien_Nt.Value = base.LocalMasterRow["TTien_Nt"];
            this.txtTTien.Value = base.LocalMasterRow["TTien"];
        }
    }
}

